package pl.mchaniewski.ryneczek.web.user;

import java.util.LinkedHashMap;
import java.util.Map;

import javax.faces.bean.ViewScoped;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;

@Component
@ViewScoped
@PreAuthorize("isAuthenticated()")
public class PaginationBean {
    private Map<Integer, Integer> companyPageList;

    public Integer getPage(Integer companyid) {
        return companyPageList.get(companyid);
    }

    public void setPage(Integer companyid, Integer page) {
        if (companyid != null) {
            companyPageList.put(companyid, page);
        }
    }

    public PaginationBean() {
        companyPageList = new LinkedHashMap<Integer, Integer>();
    }

}
